#pragma once
#include "afxcmn.h"
#include "CDMDevice.h"
#include "MonitorMessage.h"

class CResultTreeCtrl :
	public CTreeCtrl, public CMonitorMessageReceiver
{
	DECLARE_DYNAMIC(CResultTreeCtrl)

public:
	CResultTreeCtrl(void);
	~CResultTreeCtrl(void);

	BOOL FindItem(IBaseClass* pobj, HTREEITEM hStart, HTREEITEM &hReturn);
	void SetEmapPage(){m_bEmapPage = TRUE;}
	void SetEnableDrag(BOOL bEnable){m_bEnableDrag = bEnable;}
	void InsertDeviceItem(CDevice* pDevice, CString strDevName);

protected:
	virtual void OnPlatformMessage(CPlatformMessage* pMessage);
	BOOL m_bEmapPage;
	BOOL m_bEnableDrag;
	CTreeDataMap m_treeDataMap;

	DECLARE_MESSAGE_MAP()

public:
	afx_msg void OnTvnBegindrag(NMHDR *pNMHDR, LRESULT *pResult);
};
